package com.zhl.controller.dept;

import com.zhl.controller.BaseServlet;
import com.zhl.service.DeptService;
import com.zhl.service.impl.DeptServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

@WebServlet("/dept/*")
public class deptServlet extends BaseServlet {

    DeptService deptService = new DeptServiceImpl();

    public void findDeptInfo(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        List<Map<String, Object>> deptInfo = deptService.findDeptInfo();
        req.getSession().setAttribute("deptInfo",deptInfo);
        req.getRequestDispatcher("/html/department.jsp").forward(req,resp);
    }
}
